Load data into Power BI desktop and establish table relationships 2

The below screenshots show what to be expected  by following the instructions below:

       


               

1. Load GHG Historical emissions data:

As shown in GIF A below

  1. Click on Get data, select Text/CSV file, click on connect to browse to the location of the file and select GHG Historical emissions file
  2. Click on TRANSFORM to open power query
  3. Click on USE FIRST ROWS AS HEADERS above
  4. Remove the data source and unit columns as they are not needed for the report 

GIF A


As shown in GIF B below

  1. Select all columns and deselect the first 3 columns (Country, Sector, Gas), click on TRANSFROM -> UNPIVOT COLUMNS, this will put all the Year values in one column and all the emissions value in one column
  2. Right click the Attribute column and change the data type into Date, transform to end of year
  3. Right click the value column and change the data type into decimal number, right click again and replace the errors with 0, this errors are the N/A values that cannot be represented in decimal number data type

GIF B



As shown in GIF C below

  1. Rename the attribute column to Date and the Value column to GHG Emissions
  2. Filter European Union and World in the Country column as these are not countries
  3. Click close and apply

GIF C



The below screenshot shows what should be expected by following the steps above:



2. Load World population  data

  1. Repeat steps 1 to 4 as shown in GIF A but in step 1, select an Excel file instead, rename the sheet as World Population. In step 4, remove the Indicator name and Indicator code columns.
  2. Repeat step 1 and 2 as shown in GIF B to unpivot the Year and population columns and rename the attribute columns to Date
  3. Rename the value column to population. You should have the result below.
  4. Click on close and apply.



3. Load Country Flags

  1. Repeat steps 1 to 4 as shown in GIF A but in step 1, select an Excel file instead, rename the sheet as Continent_Country
  2. Rename the continent name to continent,  right click on Country column and click on Index column above 
  3. Rename the index column to Country ID
  4. Click close and apply

GIF D



4. Establish relationships

Click on Model as shown by the arrow below and a relationship has already been detected for the tables


First, you have to download Power BI Desktop

https://www.microsoft.com/en-us/download/details.aspx?id=58494